﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Azuo_Tool
{ 
[Serializable]
public class Bool_Box
{
    /// <summary>
    /// 是否激活
    /// </summary>
    public bool IsActive;

    private bool ActiveEd;

    public Action<bool> HaveChange;

    public Bool_Box(bool defalt)
    {
        IsActive = defalt;
        ActiveEd = defalt;
    }

    public void Set_Bool(bool setB)
    {
        ActiveEd = IsActive;
        IsActive = setB;
        ///bool值不等时
        if(IsActive!=ActiveEd)
        {
            if(HaveChange!=null)
            {
                HaveChange.Invoke(setB);
            }     
        }
    }
    
}
}

